package com.dailyblue.java.spring.boot.boot01.controller;

import com.dailyblue.java.spring.boot.boot01.bean.Dept;
import com.dailyblue.java.spring.boot.boot01.bean.JsonResult;
import com.dailyblue.java.spring.boot.boot01.service.DeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/dept")
public class DeptController {
    @Resource
    private DeptService deptService;

    @GetMapping
    public JsonResult<List<Dept>> find() {
        return deptService.findAllDept();
    }
}
